﻿@using Gx.Model.Entity;
@using Gx.Model.Enums;
@model LKSettlementPayment
@{
    ViewBag.Title = "添加结算收款单";
    Layout = "~/Views/Shared/InfoMaste.cshtml";
}
<link href="~/Content/css/custome.css" rel="stylesheet" />
@*<style>
        .inner_span {
            width: 100px;
            display: inline-block;
        }
    </style>*@
<div title="添加结算收款单" style="width:auto; height:auto; padding-left:5px; font-size:14px;  ">
    <div class="ftitle">
        <a href="javascript:" class="easyui-linkbutton" iconCls="icon-ok" style="height:32px" onclick="saveData()">保存</a>
        <a href="/Finance/LKSettlementPaymentList" class="easyui-linkbutton" iconCls="icon-back" style="height:32px">返回</a>
    </div>
    <form id="fm" method="post" novalidate>
        <div class="ftitle">基础信息</div>
        <div class="fitem1">
            <label>
                单据编号:
            </label>
            <input class="easyui-textbox" readonly="readonly" value="系统自动生成" style="width: 173px; height: 30px;">
            <label>
                收款时间:
            </label>
            <input class="easyui-datebox" name="PaymentTime" id="PaymentTime" value="@Model.PaymentTime" style="width: 173px; height: 30px; " data-options="required:true">
            <label>
                客户编号:
            </label>
            <select class="easyui-combogrid" style="width: 173px; height: 30px;" name="CustomerId" id="CustomerId" data-options="required:true"></select>
            <label>
                客户名称:
            </label>
            <input name="CustomerName" id="CustomerName" class="easyui-textbox" style="width: 173px; height: 30px;" readonly="readonly" data-options="required:true" />
        </div>
        <div class="fitem1">
            <label>
                付款方式
            </label>
            <input name="PaymentTypeId" id="PaymentTypeId" class="easyui-combobox" style="width: 173px; height: 30px;" />
            <label>
                银行
            </label>
            <input name="Bank" id="Bank" class="easyui-combobox" style="width: 173px; height: 30px;" />
            <label>
                发票:
            </label>
            <input name="Invoice" id="Invoice" class="easyui-textbox" style="width: 173px; height: 30px;" />
            <label>
                预收款余额:
            </label>
            <input name="PreAmount" id="PreAmount" value="@Model.PreAmount" class="easyui-numberbox" data-options="required: true,precision:'2'" style="width: 173px; height: 30px;" autocomplete="off" />
        </div>
        <div class="fitem1">
            <label>
                总金额:
            </label>
            <input name="Amount" id="Amount" value="@Model.Amount" class="easyui-numberbox" data-options="required: true,precision:'2'" style="width: 173px; height: 30px;" autocomplete="off" />
            <label>
                实收金额:
            </label>
            <input name="ActualAmount" id="ActualAmount" value="@Model.ActualAmount" class="easyui-numberbox" data-options="required: true,precision:'2'" style="width: 173px; height: 30px;" autocomplete="off" readonly />
            @*<span id="zhekouspan"></span>*@

            <label>
                现金折扣:
            </label>
            <input id="zhekouspan" name="zhekouspan" value="@Model.CashDiscount" class="easyui-numberbox" data-options="precision:'2',prompt:'现金折扣'" style="width: 173px; height: 30px;" readonly="readonly" />
            <a href="javascript:" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="addPayDetail()"></a>
        </div>
        <div class="fitem1">
            <label>
                备注:
            </label>
            <textarea rows="4" cols="4" style="width: 400px; height: 90px; vertical-align: top" name="Remark" id="Remark" autocomplete="off" placeholder="200字以内"></textarea>
        </div>
        <div class="ftitle">费用明细</div>
        <div id="Wl">
            <div title="费用清单">
                <a href="javascript:" class="easyui-linkbutton" iconcls="icon-add" plain="true" onclick="addDom()">添加</a>
                <table class="gridtable" id="detailgird">
                    <thead>
                        <tr>
                            <th>日期</th>
                            <th>截止日期</th>
                            <th>天数</th>
                            <th>商品批号</th>
                            <th>商品名称</th>
                            <th>规格</th>
                            <th>类型</th>
                            <th>柜号</th>
                            <th>件重</th>
                            <th>件数</th>
                            <th>吨重</th>
                            <th>托盘数/面积</th>
                            <th>板数</th>
                            <th>冷藏单价</th>
                            <th>冷藏费用</th>
                            <th>处置费</th>
                            <th>装卸费</th>
                            <th>加班费</th>
                            <th>分检费</th>
                            <th>过磅费</th>
                            <th>配送费</th>
                            <th>其他费</th>
                            <th>小计</th>
                        </tr>
                    </thead>
                    <tbody></tbody>
                </table>
            </div>
        </div>
        @Html.Partial("~/Views/Shared/_CreateUserAndModifyUser.cshtml")
    </form>
    <div id="customerselecttoolbar2">
        <input id="SelectCustomerText2" class="easyui-textbox " style="width: 173px; height: 30px;" />
        <a href="javascript:" class="easyui-linkbutton" plain="true" iconcls="icon-search" onclick="querycustomer2()">查询</a>
    </div>
</div>

<div id="dlg" class="easyui-dialog" title="费用明细" data-options="iconCls:'icon-save'"
     closed="true" style="width: 1050px; height: 500px; padding: 10px 20px" buttons="#dlg-buttons" modal="true">
    <div id="tb" style="padding: 3px; height: auto;">
        <span>开始时间</span>
        <input class="easyui-datebox" name="BeginTime" id="BeginTime" style="width: 173px; height: 30px; ">
        <span>结束时间</span>
        <input class="easyui-datebox" name="EndTime" id="EndTime" style="width: 173px; height: 30px; ">
        <span>商品批号</span>
        <input id="GoodsNo" class="easyui-textbox " style="width: 173px; height: 30px;" />
        <a href="javascript:" class="easyui-linkbutton" plain="true" iconcls="icon-search" onclick="doSearch()">查询</a>
    </div>
    <table id="dg" class="easyui-datagrid" style="width: 100%; height: 380px;"
           url="/Finance/GetLKSettlementPaymentDetailListByCustomer" toolbar="#tb" title="入库商品费用明细" rownumbers="true" pagination="true"
           pagelist="[15]" fitcolumns="true" singleselect="false">
        <thead>
            <tr>
                <th field="BeginTime" align="right" width="10%" formatter="formatter_BeginTime">
                    日期
                </th>
                <th field="EndTime" align="right" width="10%" formatter="formatter_EndTime">
                    截止日期
                </th>
                <th field="Days" align="right" width="10%">
                    天数
                </th>
                <th field="GoodsNo" align="right" width="10%">
                    商品批次
                </th>
                @*<th field="GoodsId" align="right" width="10%">
                        商品id
                    </th>*@
                <th field="GoodsName" align="right" width="10%">
                    商品名称
                </th>
                @*<th field="GoodsSpecId" align="right" width="10%">
                        规格
                    </th>*@
                <th field="GoodsSpecName" align="right" width="10%">
                    规格名称
                </th>
                <th field="CostType" align="right" width="10%">
                    类型
                </th>
                <th field="ContainerNumber" align="right" width="10%">
                    柜号
                </th>
                <th field="Weight" align="right" width="10%">
                    件重
                </th>
                <th field="Number" align="right" width="10%">
                    件数
                </th>
                <th field="TonWeight" align="right" width="10%">
                    吨重
                </th>
                <th field="Area" align="right" width="10%">
                    托盘数面积
                </th>
                <th field="PlateNumber" align="right" width="10%">
                    板数
                </th>
                <th field="ColdUnitPrice" align="right" width="10%">
                    冷藏单价
                </th>
                <th field="ColdCost" align="right" width="10%">
                    冷藏费用
                </th>
                <th field="Chuzhi" align="right" width="10%">
                    处置费
                </th>
                <th field="Zhuangxie" align="right" width="10%">
                    装卸费
                </th>
                <th field="Jiaban" align="right" width="10%">
                    加班费
                </th>
                <th field="Fenjian" align="right" width="10%">
                    分检费
                </th>
                <th field="Guobang" align="right" width="10%">
                    过磅费
                </th>
                <th field="Peisong" align="right" width="10%">
                    配送费
                </th>
                <th field="Qita" align="right" width="10%">
                    其他费
                </th>
                <th field="TotalAmount" align="right" width="10%">
                    总费用
                </th>
            </tr>
        </thead>
    </table>
</div>
<div id="dlg-buttons">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-ok" onclick="selectEntryCostDetail()">选择</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')">取消</a>
</div>
<div id="dlg2" class="easyui-dialog" title="付款明细" data-options="iconCls:'icon-save'"
     closed="true" style="width: 450px; height: 300px; padding: 10px 20px" buttons="#dlg-buttons" modal="true">
    <div class="fitem1">
        <label>
            现金或银行转账:
        </label>
        <input id="CashAndBank" name="ActualAmount" class="easyui-numberbox" data-options="precision:'2',prompt:'现金或银行转账'" style="width: 173px; height: 30px;" />
    </div>
    <div class="fitem1">
        <label>
            预付款扣除:
        </label>
        <input id="PrePay" name="PrePay" class="easyui-numberbox" data-options="precision:'2',prompt:'预付款扣除'" style="width: 173px; height: 30px;" />
    </div>
    <div class="fitem1">
        <label>
            现金折扣:
        </label>
        <input id="CashDiscount" name="CashDiscount" class="easyui-numberbox" data-options="precision:'2',prompt:'现金折扣'" style="width: 173px; height: 30px;" />
    </div>
</div>
<div id="dlg-buttons">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-ok" onclick="savePayDetail()">确定</a>
    <a href="javascript:void(0)" class="easyui-linkbutton" iconcls="icon-cancel" onclick="javascript:$('#dlg2').dialog('close')">取消</a>
</div>
<script src="~/Js/Global.js"></script>
<script type="text/javascript">

    $(function () {
        InitPayTypeCombobox();
        InitBankCombobox();
        InitCustomer(initCustomerPreAmount);
    });

    function initCustomerPreAmount(row) {
        var customerId = row.Id;//$("#CustomerId").combobox('getValue');
        if (customerId == "") {
            return;
        }
        $.ajax({
            url: '/Finance/GetCustomerPreAmount',
            type: "post",
            data: { CustomerId: customerId },
            success: function (json) {
                $("#PreAmount").numberbox('setValue', json);
            }
        });
    }

    function formatter_BeginTime(value, rowData, rowIndex) {
        return formatdate(rowData.BeginTime);
    }
    function formatter_EndTime(value, rowData, rowIndex) {
        return formatdate(rowData.EndTime);
    }
    var detaildom = new Array();
    function InitPayTypeCombobox(domId) {
        if (domId == undefined) {
            domId = "";
        }
        $('#PaymentTypeId' + domId).combobox({
            url: "/LkGlobal/GetPayTypeList",
            valueField: 'Value',
            textField: 'Description',
            onSelect: function (rec) {
                //$('#StoreType').combobox("setValue", rec.Value);
            }
        })
    }

    function InitBankCombobox(domId) {
        if (domId == undefined) {
            domId = "";
        }
        $('#Bank' + domId).combobox({
            url: "/LkGlobal/GetBanksList",
            valueField: 'Value',
            textField: 'Description',
            onSelect: function (rec) {
                //$('#StoreType').combobox("setValue", rec.Value);
            }
        })
    }

    function addPayDetail() {
        $('#dlg2').dialog('open').dialog('setTitle', '付款明细')
    }
    function savePayDetail() {
        var cashAndBank = $("#CashAndBank").numberbox('getValue') * 1;
        var prePay = $("#PrePay").numberbox('getValue') * 1;
        var cashDiscount = $("#CashDiscount").numberbox('getValue') * 1;
        var Amount = $("#Amount").numberbox('getValue') * 1;

        if (cashAndBank + prePay + cashDiscount != Amount) {
            Helper.Show("实收金额与冷藏金额不一致");
            return;
        }

        $("#ActualAmount").numberbox('setValue', cashAndBank + prePay + cashDiscount);
        //var zhekou="现金折扣:" + cashDiscount + "元";
        //$("#zhekouspan").text(zhekou);
        $("#zhekouspan").numberbox('setValue', cashDiscount);
        $('#dlg2').dialog('close');
    }

    function doSearch() {
        $('#dg').datagrid('load', {
            CustomerId: $("#CustomerId").combobox('getValue'),
            BeginTime: $("#BeginTime").datebox('getValue'),
            EndTime: $("#EndTime").datebox('getValue'),
            GoodsNo: $("#GoodsNo").val()
        });
    }

    var domId = 1;
    function addDom() {
        var customerId = $("#CustomerId").combobox('getValue');
        if (customerId == "") {
            Helper.Show("请选择客户");
            return;
        }
        var currentDate = new Date();
        $("#BeginTime").datebox('setValue', '');
        $("#EndTime").datebox('setValue', formatdate(currentDate));
        $("#GoodsNo").textbox('setValue','')
        $('#dlg').dialog('open').dialog('setTitle', '引入费用明细');
        $('#dg').datagrid('load', {
            CustomerId: customerId,
            BeginTime: $("#BeginTime").datebox('getValue'),
            EndTime: $("#EndTime").datebox('getValue'),
            GoodsNo: $("#GoodsNo").val()
        });
        initDom();
    }

    function initDom() {
        detaildom.length = 0;
        $("input[type='hidden'][id^='DetailDomId']").each(function () {
            var d = $(this).val();
            if ($.inArray(d, detaildom) === -1) {
                detaildom.push(d);
            }
        });

    }


    var bcArr = new Array();
    function initBcht() {
        $('span[id*="GoodsNo"]').each(function () {
            //var bc = $(this).text();
            //if ($.inArray(bc, bcArr) === -1) {
            //    bcArr.push(bc);
            //}

            //获取triggerControl的id的最后一个字符
            var id = $(this).attr("id");
            var lastChar = id.substr(id.length - 1, 1);
            var begintime = $("#BeginTime" + lastChar).text();
            var endtime = $("#EndTime" + lastChar).text();
            var goodsno = $(this).text();
            var costdetail = { BeginTime: begintime, EndTime: endtime, GoodsNo: goodsno };
            var exists = $.grep(bcArr, function (e) {
                return e.BeginTime === costdetail.BeginTime && e.EndTime === costdetail.EndTime && e.GoodsNo === costdetail.GoodsNo;
            });
            if (exists.length == 0) {
                bcArr.push(costdetail);
            }

        });
    }

    function selectEntryCostDetail() {

        var rows = $('#dg').datagrid('getSelections');
        if (rows == null) {
            Helper.Show("请选择明细");
            return;
        }
        var amount = 0;
        rows.forEach(function (value, index) {
            initBcht();
            if (value != null) {
                //var customerId = $("#CustomerId").combobox('getValue');
                //$.ajax({
                //    url: '/Finance/_AddLKSettlementPaymentBcDetail',
                //    type: "post",
                //    async: false,
                //    data: { DomId: domId, GoodsNo: value.GoodsNo, CustomerId: customerId },
                //    success: function (html) {
                //        if (html.indexOf('td') !== -1) {
                //            var ck = true;
                //            bcArr.forEach(function (bcvalue, index) {
                //                if (html.indexOf(bcvalue) > -1) {
                //                    ck = false;
                //                    return false;
                //                }
                //            });
                //            if (ck == true) {
                //                $.messager.progress('close');
                //                $("#detailgird tbody").append(html);
                //                $.parser.parse($("#" + domId));
                //                //amount += $("#TotalAmount" + domId).text() * 1;

                //            }
                //            domId = Number(domId) + 1;
                //        }
                //    }
                //});

                $.ajax({
                    url: '/Finance/_AddLKSettlementPaymentDetail',
                    type: "post",
                    async: false,
                    data: { domId: domId },
                    success: function (html) {
                        //if ($.inArray(value.GoodsNo, bcArr) === -1) {
                        //    $.messager.progress('close');
                        //    $("#detailgird tbody").append(html);
                        //    $.parser.parse($("#" + domId));
                        //    initOutDetail(domId, value);
                        //    //amount = $("#TotalAmount" + domId).text() * 1;
                        //}
                        //domId = Number(domId) + 1;

                        var ck = true;
                        bcArr.forEach(function (bcvalue, index) {
                            if (formatdate(value.BeginTime) === bcvalue.BeginTime && formatdate(value.EndTime) === bcvalue.EndTime && value.GoodsNo === bcvalue.GoodsNo) {
                                ck = false;
                                return false;
                            }
                        });

                        if (ck == true) {
                            $.messager.progress('close');
                            $("#detailgird tbody").append(html);
                            $.parser.parse($("#" + domId));
                            initOutDetail(domId, value);

                            amount += ($("#TotalAmount" + domId).text() * 1);
                        }
                        domId = Number(domId) + 1;
                    }
                });
                //amount += value.TotalAmount
            }
        });
        //$("#Amount").numberbox('setValue', getTotalAmount('TotalAmount'));

        addCostTr();


        $('#dlg').dialog('close');
    }
    function initOutDetail(id, detail) {
        $("#BeginTime" + id).text(formatdate(detail.BeginTime));
        //$("#BeginTime" + id).val(detail.BeginTime);//datebox('setValue', detail.BeginTime);
        $("#EndTime" + id).text(formatdate(detail.EndTime));
        $("#Days" + id).text(detail.Days);
        $("#GoodsNo" + id).text(detail.GoodsNo);
        $("#GoodsId" + id).val(detail.GoodsId);
        $("#GoodsName" + id).text(detail.GoodsName);
        $("#GoodsSpecId" + id).val(detail.GoodsSpecId);
        $("#GoodsSpecName" + id).text(detail.GoodsSpecName);
        $("#CostType" + id).text(detail.CostType);
        $("#ContainerNumber" + id).text(detail.ContainerNumber);

        $("#Weight" + id).text(detail.Weight);
        $("#Number" + id).text(detail.Number);

        $("#TonWeight" + id).text(detail.TonWeight);
        $("#Area" + id).text(detail.Area);
        $("#PlateNumber" + id).text(detail.PlateNumber);
        $("#ColdUnitPrice" + id).text(detail.ColdUnitPrice);
        $("#ColdCost" + id).text(detail.ColdCost);
        $("#Chuzhi" + id).text(detail.Chuzhi);
        $("#Zhuangxie" + id).text(detail.Zhuangxie);
        $("#Jiaban" + id).text(detail.Jiaban);
        $("#Fenjian" + id).text(detail.Fenjian);
        $("#Guobang" + id).text(detail.Guobang);
        $("#Peisong" + id).text(detail.Peisong);
        $("#Qita" + id).text(detail.Qita);
        $("#TotalAmount" + id).text(detail.TotalAmount);

    }

    function addCostTr() {
        $("#hjtr").remove();
        //$.parser.parse($("#hjtr"));
        $.ajax({
            url: '/Finance/_CostTotal',
            type: "post",
            async: false,
            success: function (html) {
                $.messager.progress('close');

                $('#detailgird tbody').append(html);
                //$.parser.parse($("#" + domId));
                initCostHj();
            }
        });
    }
    function initCostHj() {
        $('#ColdCosthj').text(getTotalAmount('ColdCost'));
        $('#Chuzhihj').text(getTotalAmount('Chuzhi'));
        $('#Zhuangxiehj').text(getTotalAmount('Zhuangxie'));
        $('#Jiabanhj').text(getTotalAmount('Jiaban'));
        $('#Fenjianhj').text(getTotalAmount('Fenjian'));
        $('#Guobanghj').text(getTotalAmount('Guobang'));
        $('#Peisonghj').text(getTotalAmount('Peisong'));
        $('#Qitahj').text(getTotalAmount('Qita'));
        $('#TotalAmounthj').text(getTotalAmount('TotalAmount'));

        $("#Amount").numberbox('setValue', $('#TotalAmounthj').text() * 1);
    }

    function getTotalAmount(id) {
        var totalamount = 0;
        id = 'span[id*="' + id + '"]';
        $(id).each(function () {
            var amount = $(this).text() * 1;
            totalamount += amount;
        });
        return totalamount.toFixed(2);
    }



    function delDom(domId) {
        $("#" + domId).remove();
    }


    function querycustomer2() {
        $("#CustomerId").combogrid("grid").datagrid("reload", { "CustomerName": $("#SelectCustomerText2").val() });
    }


    function saveData() {
        var validate = $("#fm").form("validate")
        if (!validate) {
            return;
        }
        var data = {
            "PaymentTime": $("#PaymentTime").datebox('getValue'),
            "CustomerId": $("#CustomerId").combobox('getValue'),//$("#hidCustomerId").val(),
            "CustomerNo": $("#CustomerId").combobox('getText'),
            "CustomerName": $("#CustomerName").textbox('getValue'),
            "PaymentTypeId": $("#PaymentTypeId").combobox('getValue'),
            "PaymentType": $("#PaymentTypeId").combobox('getText'),
            "Bank": $("#Bank").combobox('getText'),
            "PreAmount": $("#PreAmount").numberbox('getValue'),
            "Amount": $("#Amount").numberbox('getValue'),
            "ActualAmount": $("#ActualAmount").numberbox('getValue'),
            "Remark": $("#Remark").val(),
            "CashAndBank": $("#CashAndBank").numberbox('getValue'),
            "PrePay": $("#PrePay").numberbox('getValue'),
            "CashDiscount": $("#CashDiscount").numberbox('getValue'),
        };

        if (data.PrePay*1 > data.PreAmount*1) {
            Helper.Show("预付款不能大于预收款余额");
            return;
        }

        if (data.PrePay * 1 + data.CashAndBank * 1 + data.CashDiscount * 1 != data.Amount * 1) {
            Helper.Show("实收金额与冷藏金额不一致");
            return;
        }


        initDom();
        var detailList = new Array();
        detaildom.forEach(function (value, index) {
            var i = value;
            var BeginTime = $("#BeginTime" + i).text();
            var EndTime = $("#EndTime" + i).text();
            var Days = $("#Days" + i).text();
            var GoodsNo = $("#GoodsNo" + i).text();
            var GoodsId = $("#GoodsId" + i).val();
            var GoodsName = $("#GoodsName" + i).text();
            var GoodsSpecId = $("#GoodsSpecId" + i).val();
            var GoodsSpecName = $("#GoodsSpecName" + i).text();
            var CostType = $("#CostType" + i).text();
            var ContainerNumber = $("#ContainerNumber" + i).text();
            var Weight = $("#Weight" + i).text();
            var Number = $("#Number" + i).text();
            var TonWeight = $("#TonWeight" + i).text();
            var Area = $("#Area" + i).text();
            var PlateNumber = $("#PlateNumber" + i).text();
            var ColdUnitPrice = $("#ColdUnitPrice" + i).text();
            var ColdCost = $("#ColdCost" + i).text();
            var Chuzhi = $("#Chuzhi" + i).text();
            var Zhuangxie = $("#Zhuangxie" + i).text();
            var Jiaban = $("#Jiaban" + i).text();
            var Fenjian = $("#Fenjian" + i).text();
            var Guobang = $("#Guobang" + i).text();
            var Peisong = $("#Peisong" + i).text();
            var Qita = $("#Qita" + i).text();

            var detail = {
                "BeginTime": BeginTime,
                "EndTime": EndTime,
                "Days": Days,
                "GoodsNo": GoodsNo,
                "GoodsId": GoodsId,
                "GoodsName": GoodsName,
                "GoodsSpecId": GoodsSpecId,
                "GoodsSpecName": GoodsSpecName,
                "CostType": CostType,
                "ContainerNumber": ContainerNumber,
                "Weight": Weight,
                "Number": Number,
                "TonWeight": TonWeight,
                "Area": Area,
                "PlateNumber": PlateNumber,
                "ColdUnitPrice": ColdUnitPrice,
                "ColdCost": ColdCost,
                "Chuzhi": Chuzhi,
                "Zhuangxie": Zhuangxie,
                "Jiaban": Jiaban,
                "Fenjian": Fenjian,
                "Guobang": Guobang,
                "Peisong": Peisong,
                "Qita": Qita,
            };
            detailList.push(detail);
        });
        var d = JSON.stringify({ SettlementPayment: data, Details: detailList });

        $.messager.progress({
            title: '请稍后',
            msg: '数据保存中...',
        });
        window.setTimeout(function () {
            $.ajax({
                url: '/Finance/AddLKSettlementPayment',
                type: "post",
                data: d,
                contentType: 'application/json; charset=utf-8',
                success: function (json) {
                    $.messager.progress('close');
                    Helper.Show(json.Msg);
                    if (json.Success) {
                        setTimeout(function () { window.location.href = "/Finance/LKSettlementPaymentList"; }, 2000);
                    }
                }
            });
        }, 2000);
    }
</script>





